import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'D:\program\tesseract'
print(pytesseract.image_to_string(r'D:\examplepdf2image.png'))